package restaraunt.rating.project;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainMenu extends Activity {

	// Declare Variables
		
	// Declare Controls
	Button bAdd, bViw, bMet, bSgn;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_menu);
		
		// Init. Controls
		bAdd = (Button) findViewById(R.id.btAddRst);
		bViw = (Button) findViewById(R.id.btViewRates);
		bSgn = (Button) findViewById(R.id.btSignIn);
			/* btSignIn, the button to access the login screen, shouldn't
			 * be confused with the btLogin button used to actually submit
			 * the username and password. */
		
		// Init. Listeners
		bAdd.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// Go to 'Rate Food' layout
				Intent openRate = new Intent("restaraunt.rating.project.RATEFOOD");
				startActivity(openRate);
			}
		});
		
		bViw.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// Go to 'View Food' layout
				Intent openView = new Intent("restaraunt.rating.project.VIEWFOOD");
				startActivity(openView);
			}
		});
		
		bSgn.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// Go to 'Login' layout
				Intent openLogin = new Intent("restaraunt.rating.project.LOGIN");
				startActivity(openLogin);
			}
		});
	}

}
